home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / X11 / ICE / ICEutil.h < prev   
C/C++ Source or Header  |  2006-04-12  |  3KB  |  128 lines

  1. /* $Xorg: ICEutil.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
  2. /******************************************************************************
  3.  
  4.  
  5. Copyright 1993, 1998  The Open Group
  6.  
  7. Permission to use, copy, modify, distribute, and sell this software and its
  8. documentation for any purpose is hereby granted without fee, provided that
  9. the above copyright notice appear in all copies and that both that
  10. copyright notice and this permission notice appear in supporting
  11. documentation.
  12.  
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15.  
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  19. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  20. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22.  
  23. Except as contained in this notice, the name of The Open Group shall not be
  24. used in advertising or otherwise to promote the sale, use or other dealings
  25. in this Software without prior written authorization from The Open Group.
  26.  
  27. Author: Ralph Mor, X Consortium
  28. ******************************************************************************/
  29. /* $XFree86: xc/lib/ICE/ICEutil.h,v 1.4 2001/12/20 19:40:59 tsi Exp $ */
  30.  
  31. #ifndef _ICEUTIL_H_
  32. #define _ICEUTIL_H_
  33.  
  34. #include <X11/Xfuncproto.h>
  35.  
  36. #include <stdio.h>
  37. #include <X11/Xlib.h>
  38.  
  39. _XFUNCPROTOBEGIN
  40.  
  41. /*
  42.  * Data structure for entry in ICE authority file
  43.  */
  44.  
  45. typedef struct {
  46.     char            *protocol_name;
  47.     unsigned short  protocol_data_length;
  48.     char           *protocol_data;
  49.     char            *network_id;
  50.     char            *auth_name;
  51.     unsigned short  auth_data_length;
  52.     char           *auth_data;
  53. } IceAuthFileEntry;
  54.  
  55.  
  56. /*
  57.  * Authentication data maintained in memory.
  58.  */
  59.  
  60. typedef struct {
  61.     char            *protocol_name;
  62.     char        *network_id;
  63.     char            *auth_name;
  64.     unsigned short  auth_data_length;
  65.     char           *auth_data;
  66. } IceAuthDataEntry;
  67.  
  68.  
  69. /*
  70.  * Return values from IceLockAuthFile
  71.  */
  72.  
  73. #define IceAuthLockSuccess    0   /* lock succeeded */
  74. #define IceAuthLockError    1   /* lock unexpectely failed, check errno */
  75. #define IceAuthLockTimeout    2   /* lock failed, timeouts expired */
  76.  
  77.  
  78. /*
  79.  * Function Prototypes
  80.  */
  81.  
  82. extern char *IceAuthFileName (
  83.     void
  84. );
  85.  
  86. extern int IceLockAuthFile (
  87.     char *        /* file_name */,
  88.     int            /* retries */,
  89.     int            /* timeout */,
  90.     long        /* dead */
  91. );
  92.  
  93. extern void IceUnlockAuthFile (
  94.     char *        /* file_name */
  95. );
  96.  
  97. extern IceAuthFileEntry *IceReadAuthFileEntry (
  98.     FILE *        /* auth_file */
  99. );
  100.  
  101. extern void IceFreeAuthFileEntry (
  102.     IceAuthFileEntry *    /* auth */
  103. );
  104.  
  105. extern Status IceWriteAuthFileEntry (
  106.     FILE *        /* auth_file */,
  107.     IceAuthFileEntry *    /* auth */
  108. );
  109.  
  110. extern IceAuthFileEntry *IceGetAuthFileEntry (
  111.     char *        /* protocol_name */,
  112.     char *        /* network_id */,
  113.     char *        /* auth_name */
  114. );
  115.  
  116. extern char *IceGenerateMagicCookie (
  117.     int            /* len */
  118. );
  119.  
  120. extern void IceSetPaAuthData (
  121.     int            /* numEntries */,
  122.     IceAuthDataEntry *    /* entries */
  123. );
  124.  
  125. _XFUNCPROTOEND
  126.  
  127. #endif /* _ICEUTIL_H_ */
  128.